From ae52011af4ec7fcc58c89bc8f001fe5e3c2fab12 Mon Sep 17 00:00:00 2001 From: "emellor@leeni.uk.xensource.com" Date: Fri, 10 Feb 2006 03:23:36 +0100 Subject: [PATCH] Cope with -1 eventchn_fd -- this occurs when using --no-domain-init (a command line debugging option). Signed-off-by: Ewan Mellor --- tools/xenstore/xenstored_core.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tools/xenstore/xenstored_core.c b/tools/xenstore/xenstored_core.c index 82080ee70e..2dbcaced5d 100644 --- a/tools/xenstore/xenstored_core.c +++ b/tools/xenstore/xenstored_core.c @@ -339,6 +339,8 @@ static int destroy_conn(void *_conn) static void set_fd(int fd, fd_set *set, int *max) { + if (fd < 0) + return; FD_SET(fd, set); if (fd > *max) *max = fd; @@ -1670,7 +1672,7 @@ int main(int argc, char *argv[]) if (FD_ISSET(*ro_sock, &inset)) accept_connection(*ro_sock, false); - if (FD_ISSET(eventchn_fd, &inset)) + if (eventchn_fd > 0 && FD_ISSET(eventchn_fd, &inset)) handle_event(); list_for_each_entry(i, &connections, list) { -- 2.30.2